package com.timedomain.him.remake.ui;

import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.timedomain.him.remake.R;
import com.timedomain.him.remake.utils.BaseActivity;

import org.jetbrains.annotations.Nullable;

public class AboutActivity extends BaseActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about);
        try {
            ((TextView)findViewById(R.id.txtAboutVersion)).setText("版本："+getPackageManager().getPackageInfo(getPackageName(),0).versionName);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
    }

    public void gotoOpensourcePage(View view) {
        Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("https://gitee.com/ZYFDroid/him-remake"));
        startActivity(i);
    }

    public void gotoCCBYLicense(View view) {
        Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://creativecommons.org/licenses/by/4.0/"));
        startActivity(i);
    }

    public void gotoBugReport(View view) {
        startActivity(new Intent(this,BugreportActivity.class));
    }
}
